﻿<Window x:Class="CL_Searcher.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Craigslist Searcher by Ivan Josipovic" Height="559" Width="844" Closed="Window_Closed" Icon="Icon.png">
    <Grid>
        <Label Content="Search for:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/>
        <TextBox x:Name="txt_Query" HorizontalAlignment="Left" Height="23" Margin="81,12,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="182"/>
        <Label Content="in:" HorizontalAlignment="Left" Margin="268,10,0,0" VerticalAlignment="Top"/>
        <ComboBox x:Name="dd_Category" HorizontalAlignment="Left" Margin="295,12,0,0" VerticalAlignment="Top" Width="140" ItemsSource="{Binding Categories}" DisplayMemberPath="Description" SelectedValuePath="Description" ToolTip="Search Category"/>
        <Label Content="Price:" HorizontalAlignment="Left" Margin="10,39,0,0" VerticalAlignment="Top"/>
        <TextBox x:Name="txt_MinPrice" HorizontalAlignment="Left" Height="23" Margin="53,41,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="55" ToolTip="Minimum Price"/>
        <Label Content="to" HorizontalAlignment="Left" Margin="109,40,0,0" VerticalAlignment="Top"/>
        <TextBox x:Name="txt_MaxPrice" HorizontalAlignment="Left" Height="23" Margin="131,41,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="55" ToolTip="Maximum Price"/>
        <CheckBox x:Name="ckb_HasImage" Content="Has Image" HorizontalAlignment="Left" Margin="200,45,0,0" VerticalAlignment="Top" ToolTip="Show only posts which have images"/>
        <CheckBox x:Name="ckb_TitleOnly" Content="Title Only" HorizontalAlignment="Left" Margin="285,45,0,0" VerticalAlignment="Top" IsChecked="True" ToolTip="Search only the tite of the posts"/>
        <Label Content="Country:" HorizontalAlignment="Left" Margin="10,67,0,0" VerticalAlignment="Top"/>
        <ComboBox x:Name="dd_Country" HorizontalAlignment="Left" Margin="70,69,0,0" VerticalAlignment="Top" Width="140" ItemsSource="{Binding Locations}" DisplayMemberPath="Name" SelectedValuePath="Name"/>
        <Label Content="Region:" HorizontalAlignment="Left" Margin="10,98,0,0" VerticalAlignment="Top"/>
        <ComboBox x:Name="dd_Region" HorizontalAlignment="Left" Margin="70,100,0,0" VerticalAlignment="Top" Width="140" ItemsSource="{Binding SelectedItem.Regions, ElementName=dd_Country}" DisplayMemberPath="Name" SelectedValuePath="Name"/>
        <Label Content="City:" HorizontalAlignment="Left" Margin="10,126,0,0" VerticalAlignment="Top"/>
        <ComboBox x:Name="dd_City" HorizontalAlignment="Left" Margin="70,128,0,0" VerticalAlignment="Top" Width="140" ItemsSource="{Binding SelectedItem.Cities, ElementName=dd_Region}" DisplayMemberPath="Name" SelectedValuePath="Name"/>
        <DataGrid x:Name="grid" Margin="10,159,10,30" Height="auto" Width="auto" MouseDoubleClick="Grid_MouseDoubleClick" IsReadOnly="True" AutoGenerateColumns="False" />
        <ListBox x:Name="lst_Locations" HorizontalAlignment="Left" Height="81" Margin="215,69,0,0" VerticalAlignment="Top" Width="200" ItemsSource="{Binding SelectedLocations}" DisplayMemberPath="Url" SelectedValuePath="Url"/>
        <Button x:Name="btn_AddLocation" Content="Add" HorizontalAlignment="Left" Margin="420,69,0,0" VerticalAlignment="Top" Width="50" Click="Btn_AddLocation_Click" ToolTip="Add the Location"/>
        <Button x:Name="btn_RemoveLocation" Content="Remove" HorizontalAlignment="Left" Margin="420,98,0,0" VerticalAlignment="Top" Width="50" Click="Btn_RemoveLocation_Click" ToolTip="Remove the Location"/>
        <Button x:Name="btn_SearchItemAdd" Content="Add" HorizontalAlignment="Left" Margin="440,13,0,0" VerticalAlignment="Top" Width="75" Click="Btn_SearchQueryAdd_Click" ToolTip="Add the Search Query"/>
        <StatusBar Height="20" VerticalAlignment="Bottom" >
            <StatusBarItem Grid.Column="0" x:Name="txt_StatusBar" Content="" Width="236"/>
            <ProgressBar Grid.Column="2" x:Name="ProgressBar" HorizontalAlignment="Stretch" />
        </StatusBar>
        <Button x:Name="btn_OpenSettings" Content="Settings" HorizontalAlignment="Right" Margin="0,10,10,0" VerticalAlignment="Top" Width="75" Click="Btn_OpenSettings_Click" ToolTip="Open the Settings Page"/>
        <Button x:Name="btn_Refresh" Content="Refresh" HorizontalAlignment="Right" Margin="0,35,10,0" VerticalAlignment="Top" Width="75" Click="Btn_Refresh_Click" ToolTip="Refrest all the Searches"/>
        <Button x:Name="btn_UnhideAll" Content="Unhide All" Margin="0,60,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="75" ToolTip="Show all Hidden Posts" Click="Btn_UnhideAll_Click"/>
        <CheckBox x:Name="ckb_EmailNewPosts" Content="Email New Posts" HorizontalAlignment="Right" Margin="0,85,10,0" VerticalAlignment="Top" IsChecked="{Binding Settings.EmailNewPosts, Mode=TwoWay}" ToolTip="When checked, the application will search for new posts every 30 mins and send an email with the Post info."/>
    </Grid>
</Window>
